import axios from '@/libs/api.request'

export const getMenu = (menu) => {
    const data = new URLSearchParams()
    for (let key in menu) {
      data.append(key,menu[key])
    }
    return axios.request({
      url: '/models/newModel',
      data,
      method: 'post'
    })
  }

  export const getLink = (menu)=>{
    const data = new URLSearchParams()
      for (let key in menu) {
        data.append(key,menu[key])
      }
      return axios.request({
        url: '/models/newModel',
        data,
        method: 'post'
      })
  }
  export const getList = (menu)=>{
    const data = new URLSearchParams()
      for (let key in menu) {
        data.append(key,menu[key])
      }
      return axios.request({
        url: 'models/getlist',
        data,
        method: 'post'
      })
  }

  export const deleteItem = (id)=>{
    return axios.request({
      url: '/models/'+id,
      method: 'delete'
    })
  }

  export const deployItem = (id)=>{
    return axios.request({
      url: '/models/'+id+'/deployment',
      method: 'post'
    })
  }

